//
//  LSZDetailsVideoSelectionManager.m
//  JK九酷云头条
//
//  Created by 九酷 on 2017/11/7.
//  Copyright © 2017年 LC. All rights reserved.
//

#import "LSZDetailsVideoSelectionManager.h"

@implementation LSZDetailsVideoSelectionManager
-(id)initWithDetailsVideoSelectionManager:(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        self.mutDataArray = [[NSMutableArray alloc]init];
        if ([[dic valueForKey:@"data"] isKindOfClass:[NSString class]]) {
            return self;
        }
        if ([[dic valueForKey:@"data"] isKindOfClass:[NSNumber class]]) {
            return self;
        }
        if (![dic valueForKey:@"data"]) {
            return self;
        }
        NSArray * diction = dic[@"data"];
        NSMutableArray * arrayMut = [[NSMutableArray alloc]init];
        NSMutableArray * arrayPaly = [[NSMutableArray alloc]init];

        for (NSDictionary * dicData in  diction) {
            NSString * id_id = [NSString stringWithFormat:@"%@",dicData[@"id"]];
            if ([id_id isEqualToString:@"0"]) {
                 //广告
            }else
            {
                NSMutableDictionary * dicMutDic = [[NSMutableDictionary alloc]initWithDictionary:dicData];
                [dicMutDic setValue:@(ScreenWidth) forKey:@"img_w"];
                [dicMutDic setValue:@(210) forKey:@"img_h"];
                [arrayPaly addObject:dicMutDic];
                
                LSZDetailsVideoSelectionMg * mg = [[LSZDetailsVideoSelectionMg alloc]init];
                mg.source = [NSString stringWithFormat:@"%@",dicData[@"source"]];
                NSString * timeStr = [NSString stringWithFormat:@"%@",dicData[@"uptime"]];
                 mg.uptime = [LSZSpecialPackaging GetThePreviousTimeAndCompareItNow:timeStr];
                mg.pic_url = [NSString stringWithFormat:@"%@",dicData[@"pic_url"]];
                mg.title = [NSString stringWithFormat:@"%@",dicData[@"title"]];
                mg.video_url = [NSString stringWithFormat:@"%@",dicData[@"video_url"]];
                mg.source_name = [NSString stringWithFormat:@"%@",dicData[@"source_name"]];
                mg.url = [NSString stringWithFormat:@"%@",dicData[@"url"]];
                mg.id_id = [NSString stringWithFormat:@"%@",dicData[@"id"]];
                [arrayMut  addObject:mg];
            }
        }
        self.mutDataPlayArray = arrayPaly;
        self.mutDataArray = arrayMut;
    }
    return self;
}
@end

@implementation LSZDetailsVideoSelectionMg
@end
